package abstractfactorypattern.factory;

import abstractfactorypattern.service.Color;
import abstractfactorypattern.service.Shape;
import abstractfactorypattern.service.impl.Blue;
import abstractfactorypattern.service.impl.Green;
import abstractfactorypattern.service.impl.Red;

/**
 * @Author： yu.Tan
 * @Date: 2020/10/9 9:23
 * @Description:
 */
public class ColorFactory extends AbstractFactory {
    @Override
    public Color getColor(String color) {
        if (color == null) {
            return null;
        }
        if (color.equalsIgnoreCase("RED")) {
            return new Red();
        } else if (color.equalsIgnoreCase("GREEN")) {
            return new Green();
        } else if (color.equalsIgnoreCase("BLUE")) {
            return new Blue();
        }
        return null;
    }

    @Override
    public Shape getShape(String shape) {
        return null;
    }
}
